<?php 
trait TradeDetailTrait {
	public function getTradestatustxt()
	{
		if($this->TRADE_STATUS == self::TRADE_STATUS_STARTUP){
			return '待扫码';
		}else if($this->TRADE_STATUS == self::TRADE_STATUS_SUCCESS){
			return '交易成功';
		}else if($this->TRADE_STATUS == self::TRADE_STATUS_FAILED){
			return '交易失败';
		}else if($this->TRADE_STATUS == self::TRADE_STATUS_CANCELED){
			return '交易已撤销';
		}else if($this->TRADE_STATUS == self::TRADE_STATUS_REFUND){
			return '交易已退款';
		}
	}
	
	public function getTradedone()
	{
		if(in_array($this->TRADE_STATUS, array(self::TRADE_STATUS_STARTUP))){
			return self::TRADE_DONE_N;
		}else if(in_array($this->TRADE_STATUS, array(self::TRADE_STATUS_SUCCESS, self::TRADE_STATUS_REFUND, self::TRADE_STATUS_CANCELED))){
			return self::TRADE_DONE_SUCCESS;
		}else{
			return self::TRADE_DONE_FAIL;
		}
	}
}